<template>
	<view class="">
		<view class="u-p-20">

		</view>
		<view class="u-flex u-row-between bg_FFFFFF u-p-l-20 u-p-r-20">
			<view class="u-h-100">
				<view class="u-m-t-30" style="border-left: 10rpx solid red;padding-left: 30rpx;">
					收款记录
				</view>
			</view>
		</view>
		<view class="u-p-l-20 u-p-r-20">
			<u-table>
				<u-tr class="u-tr">
					<u-th class="u-th">今日收款</u-th>
					<u-th class="u-th">昨日收款</u-th>
					<u-th class="u-th">本月收款</u-th>
					<u-th class="u-th">上月收款</u-th>
				</u-tr>
				<u-tr class="u-tr">
					<u-td class="u-td">{{logMap.today}}</u-td>
					<u-td class="u-td">{{logMap.yesterday}}</u-td>
					<u-td class="u-td">{{logMap.month}}</u-td>
					<u-td class="u-td">{{logMap.last_month}}</u-td>
				</u-tr>
			</u-table>
		</view>
		
		<view class="u-p-20">
			<view class="bg_FFFFFF u-p-20 u-b-r-16 ">
				<view class="u-p-t-20 u-p-b-20" style="border-bottom: 1rpx solid  #F1F2F6;" v-for='(item,index) in list'
					:key="item.id">
					<view class="u-flex u-row-between">
						<view class="u-weight">
							收款
						</view>
						<view class="" style="color: red;">
							{{item.pay_amount}}元
						</view>
					</view>
					<view class="u-m-t-10 u-font-28" style="display: flex;justify-content: space-between;">
						<!-- {{item.type==1?item.mobile || '':item.type==2?item.gas || '':item.type==3?item.elec_no || '':''}} -->
						<text>
							抵扣金比例：{{item.deduction_percent+'%' || ''}}
						</text>
						<text>
							{{item.create_time || ''}}
						</text>
					</view>
					<view class="u-m-t-10 u-font-28" style="display: flex;justify-content: space-between;">
						<!-- {{item.type==1?item.mobile || '':item.type==2?item.gas || '':item.type==3?item.elec_no || '':''}} -->
						<text>
							支付状态：{{item.status|| ''}}
						</text>

					</view>
				</view>

				<!-- 加载更多 -->
				<u-loadmore :status="status" icon-type="circle" margin-top="20" margin-bottom="20" />
			</view>


		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				params: {
					type: "",
					keyword: '',
					page: 1,
					page_size: 10,
					s_time: '',
					e_time: '',
					all: 0
				},
				list: [],
				show: false,
				mode: 'range',
				status: 'nomore',
				logMap: {}

			}
		},
		onLoad(load) {
			this.params.type = load.type
			this.scanStatistics()

		},
		onShow() {
			this.massage()
		},

		methods: {
			scanStatistics() {
				this.$api.scanStatistics(this.params, res => {
					console.log(res)
					this.logMap = res.data.data
				})
			},
			clear() {
				this.list = [];
				this.params.page = 1;
			},
			massage() {
				this.$api.scanLog(this.params, res => {
					this.list = res.data.data
				})
			},

		}
	}
</script>

<style scoped>
	page {
		background: #f5f5f5;
	}
</style>